package datalookin.adapter;

import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

import com.whu.zj.MyApplication;
import com.whu.zj.R;

import java.util.ArrayList;
import java.util.List;

import model.Stationnumposition;

/**
 * 选择站点
 * Created by Administrator on 2016/3/5.
 */
public class ChooseStationAdapter extends BaseAdapter {

    List<Stationnumposition> stations = new ArrayList<Stationnumposition>();

    public void setStations(List<Stationnumposition> stations) {
        this.stations = stations;
    }

    @Override
    public int getCount() {
        return stations.size();
    }

    @Override
    public Object getItem(int position) {
        return null;
    }

    @Override
    public long getItemId(int position) {
        return 0;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        convertView = View.inflate(MyApplication.share(), R.layout.item_spinner,null);
        TextView tv_item = (TextView) convertView.findViewById(R.id.item);
        Stationnumposition stationnumposition = stations.get(position);
        tv_item.setText(stationnumposition.getPositionname());
        return convertView;
    }
}
